apply intermediate value theorem